package shiyanbaogao;

import java.util.Scanner;

    // 1. 定义支付接口
    interface Payment {
        void pay(double amount);
    }

    // 3. 银行卡支付实现
    class BankCardPayment implements Payment {
        @Override
        public void pay(double amount) {
            System.out.printf("使用银行卡支付成功，金额：%.2f 元\n", amount);
        }
    }

    // 4. 支付宝支付实现
    class AlipayPayment implements Payment {
        @Override
        public void pay(double amount) {
            System.out.printf("支付宝支付成功，金额：%.2f 元\n", amount);
        }
    }

    // 5. 微信支付实现
    class WechatPayment implements Payment {
        @Override
        public void pay(double amount) {
            System.out.printf("微信支付成功，金额：%.2f 元\n", amount);
        }
    }

    // 7. 测试类

